<table id="22cac87a-0626-4496-98a9-67694e852067_grid"
	data-options="border:false"></table>
<div id='505316c3-e96e-4f9c-b99e-cdb90ac07c23search'>
	<div style="margin-bottom: 5px; padding-left: 5px; margin-top: 5px;">
		<form id='reportSearchForm10'>
			<table>
				<tr>
					<td>角色名称</td>
					<td><input name='name' width='150px'
						class='easyui-validatebox easyui-textbox' /></td>
					<td><a href='javascript:void(0)' class='easyui-linkbutton'
						iconCls='icon-search' plain='true' onclick='reportSearch10()'>查询</a><a
						href='javascript:void(0)' class='easyui-linkbutton'
						iconCls='icon-clear' plain='true'
						onclick='clearConfigReportSearch10()'>清空</a></td>
				</tr>
			</table>
		</form>
	</div>
	<div style='height: auto'>
		<a href='javascript:void(0)' class='easyui-linkbutton'
			iconCls='icon-export' plain='true' onclick='exportReport10()'>导出报表</a><a
			href='avascript:void(0)' class='easyui-linkbutton'
			iconCls='icon-large-chart' plain='true' onclick='chartReport10()'>图表分析</a>
	</div>
</div>
<div style="height: auto">
	<a href="javascript:void(0)" class="easyui-linkbutton"
		iconCls="icon-export" plain="true" onclick="exportReport3()">导出报表</a>
	<a href="javascript:void(0)" class="easyui-linkbutton"
		iconCls="icon-large-chart" plain="true" onclick="chartReport3()">图表分析</a>
</div>

<script type="text/javascript">
	//表格查询  
	function reloadConfig10() {
		$('#22cac87a-0626-4496-98a9-67694e852067_grid').datagrid('reload'); //设置好查询参数 reload 一下就可以了  
		$('#22cac87a-0626-4496-98a9-67694e852067_grid').datagrid('unselectAll');
		$('#22cac87a-0626-4496-98a9-67694e852067_grid').datagrid('uncheckAll');
	}
	function reportSearch10() {
		setConfigReportSearchParams10(false);
		reloadConfig10();
	}

	function moreReportSearch10(btn) {
		$('.hiddenSearchTr10').toggle();
		printLog($(".hiddenSearchTr10").is(":hidden"));
		if (!$(".hiddenSearchTr10").is(":hidden")) {
			$('#moreSearchBtn10 .l-btn-left span.l-btn-icon').removeClass(
					'layout-button-down');
			$('#moreSearchBtn10 .l-btn-left span.l-btn-icon').addClass(
					'layout-button-up');
			$('#moreSearchBtn10 .l-btn-left .l-btn-text').html('收起');
		} else {
			$('#moreSearchBtn10 .l-btn-left span.l-btn-icon').removeClass(
					'layout-button-up');
			$('#moreSearchBtn10 .l-btn-left span.l-btn-icon').addClass(
					'layout-button-down');
			$('#moreSearchBtn10 .l-btn-left .l-btn-text').html('更多');
		}
	}

	function clearConfigReportSearch10() {
		$('#reportSearchForm10').form('clear');
		setConfigReportSearchParams10(true);
		reportSearch10();
	}
	//设置查询参数或清空查询参数
	function setConfigReportSearchParams10(isClear) {
		var fields = $('#reportSearchForm10').serializeArray(); //自动序列化表单元素为JSON对象  
		var params = $('#22cac87a-0626-4496-98a9-67694e852067_grid').datagrid(
				'options').queryParams; //先取得 datagrid 的查询参数  
		$.each(fields, function(i, field) {
			if (isClear) {
				delete params[field.name];
			} else {
				params[field.name] = field.value; //设置查询参数
			}
		});
		printLog(params);
	}
	function exportReport10() {
		// 		var selectReportNode = $('#configReportTree').tree('getSelected');
		// 		printLog(selectReportNode);
		// 		if(selectReportNode) {

		var options = $('#22cac87a-0626-4496-98a9-67694e852067_grid').datagrid(
				'getPager').data("pagination").options;
		var curr = options.pageNumber;
		var total = options.total;
		printLog(curr + '----' + total);
		createFromWindowOptions({
			title : "导出报表",
			maximizable : false,
			width : 400,
			height : 200,
			href : "readReport.do?exportWin&configId=" + 10 + "&totalRecord="
					+ total,
			callback : function(data) {
				exportReportFormAction('22cac87a-0626-4496-98a9-67694e852067_grid');
			},
			enableSaveButton : true
		});
		// 			createFromWindow("导出报表", "readReport.do?exportWin&configId=" + selectReportNode.id,
		// 					"config.do?saveConfig", function(data) {
		// //	 					reloadConfig();
		// 					},true);
		// 		}else {
		// 			showMsg('请选中左侧需导出的报表项.');
		// 		}
	}

	function chartReport10() {
		// 		var selectReportNode = $('#configReportTree').tree('getSelected');
		// 		printLog(selectReportNode);
		// 		if(selectReportNode) {
		createFromWindowOptions({
			title : "图表显示",
			maximizable : false,
			width : 600,
			height : 500,
			href : "readReport.do?chartWin&configId=" + 10,
			callback : function(data) {

			},
			enableSaveButton : false
		});
		// 		}else {
		// 			showMsg('请选中左侧需导出的报表项.');
		// 		}
	}

	$('#22cac87a-0626-4496-98a9-67694e852067_grid').datagrid({
		url : 'readReport.do?loadConfigReportData',
		height : 'auto',
		striped : 'false',
		checkbox : true,
		fit : true,
		selectOnCheck : false,
		checkOnSelect : false,
		// 		toolbar:'#configlist_search',
		loadMsg : '数据加载中，请稍等...',
		queryParams : {
			time : new Date().getTime(),
			reportId : 10
		},
		rownumbers : true,
		singleSelect : true,
		idField : 'id',
		pageSize : 30,
		pageList : [ 10, 30, 50, 100 ],
		pagination : true,
		columns : [ [ {
			"field" : "NAME",
			"title" : "角色名称",
			"width" : 80
		}, {
			"field" : "NUM",
			"title" : "角色等级数",
			"width" : 150
		} ] ],
		toolbar : '#505316c3-e96e-4f9c-b99e-cdb90ac07c23search'
	// 		toolbar: [{  
	//             text: '导出报表',  
	//             iconCls: 'icon-export',  
	//             handler: function() {
	// 				exportReport10();
	//             }  
	//         }, '-', {  
	//             text: '图表分析',  
	//             iconCls: 'icon-edit',  
	//             handler: function() {  
	// 				chartReport10();
	//             }  
	//         }],  
	});
	$('#22cac87a-0626-4496-98a9-67694e852067_grid').datagrid('getPager')
			.pagination({
				beforePageText : '第',
				afterPageText : '页    共 {pages} 页',
				displayMsg : '当前显示 {from} - {to} 条记录   共 {total} 条记录',
			});
</script>


